<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
      <%@taglib prefix="st" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<script type="text/javascript">

function validaciones(f){

	
	if(f.razonsocial.value == '' || f.direccion.value == '' || f.ruc.value == ''){
		alert('Ingresar todos los datos para registrar el proveedor correctamente.');	
			if(f.razonsocial.value == ''){
				f.razonsocial.focus();
			}else{
				if(f.direccion.value == ''){
					f.direccion.focus();
				}else{
					if(f.ruc.value == ''){
						f.ruc.focus();
					}
				}
			}
		return false;
	}

	return true;

	
}

</script>
<body>
<table width="100%">
		<tr>
			<td class="Estilo5">Datos de Proveedor:</td>
		</tr>
	</table>
<st:form action="registrarProveedor" onsubmit="return validaciones(this)">
		<table width="540" border="0" class="Estilo7"
			style="border-width: 1px; border-radius: 5px; border-style: solid; border-color: #AAA;">
			
			<tr>
				<td>Razon Social</td>
				<td width="180"><st:textfield label="razonSocial"
						name="proveedor.razonSocial" id="razonsocial">
					</st:textfield></td>
			</tr>
			<tr>
				<td>Direccion</td>
				<td width="180"><st:textfield label="Direccion"
						name="proveedor.direccion" id="direccion">
					</st:textfield></td>
			</tr>
			<tr>
				<td>RUC</td>
				<td width="180"><st:textfield label="RUC" name="proveedor.ruc" id="ruc">
					</st:textfield></td>
					</tr>
					<tr>
				<td width="180"><st:submit value="Registrar Proveedor" href="<st:url action ='registrarProveedor'/>"></st:submit></td>
			</tr>
		</table>
</st:form>
</body>
</html>